package com.ihr360.rest.config;


import com.ihr360.rest.core.Ihr360EnumTranslationConfiguration;
import com.ihr360.rest.core.Ihr360MetadataConfiguration;
import com.ihr360.rest.core.Ihr360ProjectionDefinitionConfiguration;
import org.springframework.data.rest.core.config.ProjectionDefinitionConfiguration;
import org.springframework.util.Assert;

public class Ihr360RestConfiguration {
    private final Ihr360ProjectionDefinitionConfiguration projectionConfiguration;
    private final Ihr360MetadataConfiguration metadataConfiguration;
    private final Ihr360EnumTranslationConfiguration enumTranslationConfiguration;

    /**
     * Creates a new {@link Ihr360RestConfiguration} with the given {@link ProjectionDefinitionConfiguration}.
     *
     * @param projectionConfiguration      must not be {@literal null}.
     * @param metadataConfiguration        must not be {@literal null}.
     * @param enumTranslationConfiguration must not be {@literal null}.
     */
    public Ihr360RestConfiguration(Ihr360ProjectionDefinitionConfiguration projectionConfiguration,
                                   Ihr360MetadataConfiguration metadataConfiguration, Ihr360EnumTranslationConfiguration enumTranslationConfiguration) {

        Assert.notNull(projectionConfiguration, "ProjectionDefinitionConfiguration must not be null!");
        Assert.notNull(metadataConfiguration, "MetadataConfiguration must not be null!");
        Assert.notNull(enumTranslationConfiguration, "EnumTranslationConfiguration must not be null!");

        this.projectionConfiguration = projectionConfiguration;
        this.metadataConfiguration = metadataConfiguration;
        this.enumTranslationConfiguration = enumTranslationConfiguration;
    }

    /**
     * Returns the {@link Ihr360ProjectionDefinitionConfiguration} to register addition projections.
     *
     * @return
     */
    public Ihr360ProjectionDefinitionConfiguration getProjectionConfiguration() {
        return projectionConfiguration;
    }

    /**
     * Returns the {@link Ihr360MetadataConfiguration} to customize metadata exposure.
     *
     * @return
     */
    public Ihr360MetadataConfiguration getMetadataConfiguration() {
        return metadataConfiguration;
    }
    /**
     * Returns the {@link Ihr360EnumTranslationConfiguration} to be used.
     *
     * @return must not be {@literal null}.
     */
    public Ihr360EnumTranslationConfiguration getEnumTranslationConfiguration() {
        return this.enumTranslationConfiguration;
    }


}